#ifndef _DECO_ARCHIVE
#define _DECO_ARCHIVE

#include "RenderType.h"
#include <fstream>
#include <string>
using namespace std;

enum ArchiveType
{
	AT_Read,
	AT_Write

};
class DecoArchive
{
private:
	UINT m_version;
	string m_filePath;
	fstream m_fileStream;
	UINT m_type;

public:
	DecoArchive();
	~DecoArchive();
	DecoArchive(string filename, UINT type);
	void Create(string filename, UINT type);
	void Flush();
	UINT Tell();
	string GetFilePath() const
	{
		return m_filePath;
	}
	friend DecoArchive& operator<< (DecoArchive& Ar, DOUBLE value);
	friend DecoArchive& operator<< (DecoArchive& Ar, INT value);
	friend DecoArchive& operator<< (DecoArchive& Ar, FLOAT value);
	friend DecoArchive& operator<< (DecoArchive& Ar, UINT value);
	friend DecoArchive& operator<< (DecoArchive& Ar, const string& str);
	friend DecoArchive& operator<< (DecoArchive& Ar, char chr);
	friend DecoArchive& operator<< (DecoArchive& Ar, BYTE vlaue);
	friend DecoArchive& operator<< (DecoArchive& Ar, SHORT value);

	friend DecoArchive& operator>> (DecoArchive& Ar, SHORT& value);
	friend DecoArchive& operator>> (DecoArchive& Ar, DOUBLE &value);
	friend DecoArchive& operator>> (DecoArchive& Ar, INT &value);
	friend DecoArchive& operator>> (DecoArchive& Ar, FLOAT &value);
	friend DecoArchive& operator>> (DecoArchive& Ar, UINT &value);
	friend DecoArchive& operator>> (DecoArchive& Ar, string &str);
	friend DecoArchive& operator>> (DecoArchive& Ar, char &chr);
	friend DecoArchive& operator>> (DecoArchive& Ar, BYTE& vlaue);
};

#endif